# Contributor: Danilo Godec <danilo.godec@agenda.si>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pptpd
pkgver=1.4.0
pkgrel=5
pkgdesc="PoPToP - PPTP Daemon, Linux as Microsoft VPN Server"
url="http://www.poptop.org/"
# does not build against pppd 2.5
#arch="all"
license="GPL-2.0-or-later"
depends="ppp-daemon"
makedepends="ppp-dev"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://sourceforge.net/projects/poptop/files/pptpd/pptpd-$pkgver/pptpd-$pkgver.tar.gz/download
	fix_MSG_TRYHARD.patch
	pptpd.patch
	pptpd.confd
	pptpd.initd
	options.pptp
	pptpd.conf
	"
options="!check"

build() {
	./configure --prefix=/usr --sysconfdir=/etc
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
	install -Dm755 "$srcdir"/pptpd.initd "$pkgdir"/etc/init.d/pptpd
	install -Dm644 "$srcdir"/pptpd.confd "$pkgdir"/etc/conf.d/pptpd
	install -Dm644 "$srcdir"/options.pptp "$pkgdir"/etc/ppp/options.pptp
	install -Dm644 "$srcdir"/pptpd.conf "$pkgdir"/etc/
}

sha512sums="cfb4caef3025c0721e7fabf8b7bf595739f2d3048555b30616cdadc37e70ba9e1c50561c25091dd617b5448da2816aeaf83aea0fc2ef6b0dd5e3fe35d9591484  pptpd-1.4.0.tar.gz
718e9fd6a53322f2f390ee4d07b2b4f88b6dd3ad130d4471a4e12e82910942982a06865c06296ff26f08e87aa65f4f7ee4a020cf7c2ff0d67ca5bfb794fe10bc  fix_MSG_TRYHARD.patch
2adbd7203451fe63472fdd443afcf9c85b66d1d4965574f94a7e99a29fdd7f37cfe1eb0f82afebef0e6e11726e0702208e75e90f9867b1103f1d5e401f8ba47f  pptpd.patch
59f118715cf6c36442687a58f46a54519fb5125383e85c4fa352a4c97f8a4e19f46c9715330550755eb9691e8174b70cdfab48fbd14c2707364e8083d6baa488  pptpd.confd
7ccca8dd0c5ecc8bc0352b8e3bed30c7e9ab3591d07ffdf62a7305406a4685b638446d4b0a65753ceaa5bae4f63fb39f9bf6b590e1837851c0a6676d305b3612  pptpd.initd
acf235a1c34f34cded7f2c56d6757fec099032ffaefae003e79b0517ad3fc53e19698e8c644193da9613707f8923b9c78f9e642aa0d9c785db1d4e51717a486e  options.pptp
ed6022b6711b0e6b3e336220d6da7ec9dd7d3a0679fc9219d0931f3b165296b80bc21e23123cc0ed621d76d06d5ad3435659eb7b924daa735ee1a069c1ebcbc1  pptpd.conf"
